import request from '@/config/axios'

// 质检平台-机构人员 VO
export interface OrganizationStaffVO {
  id: number // 主键id
  type: number // 人员类型: 0-机构管理员 1-抽样人员 2-检验人员 3-技术审批人
  name: string // 姓名
  gerden: number // 性别 0-女 1-男
  identityCard: string // 身份证
  email: string // 邮箱
  phone: string // 手机号
  orgId: number // 机构id
  isOnJob: number // 是否在职: 0-在 1-不在
  attachment: string // 附件：多个“;”隔开  最多五个
}

// 质检平台-机构人员 API
export const OrganizationStaffApi = {
  // 查询质检平台-机构人员分页
  getOrganizationStaffPage: async (params: any) => {
    return await request.get({ url: `/qis/organization-qualification/page`, params })
  },

  // 查询质检平台-机构人员详情
  getOrganizationStaff: async (id: number) => {
    return await request.get({ url: `/qis/organization-staff/get?id=` + id })
  },

  // 新增质检平台-机构人员
  createOrganizationStaff: async (data: OrganizationStaffVO) => {
    return await request.post({ url: `/qis/organization-qualification/create`, data })
  },

  // 修改质检平台-机构人员
  updateOrganizationStaff: async (data: OrganizationStaffVO) => {
    return await request.put({ url: `/qis/organization-qualification/update`, data })
  },

  // 删除质检平台-机构人员
  deleteOrganizationStaff: async (id: number) => {
    return await request.delete({ url: `/organization-qualification/delete?id=` + id })
  },

  // 导出质检平台-机构人员 Excel
  exportOrganizationStaff: async (params) => {
    return await request.download({ url: `/qis/organization-staff/export-excel`, params })
  },


  // 获取机构人员分页
  getJgrypageApi: async (params: any) => {
    return await request.get({ url: `/qis/organization-staff/page`, params })
  },

  // 创建机构人员
  createJgryApi : async (data: OrganizationStaffVO) => {
    return await request.post({ url: `qis/organization-staff/create`, data })
  },

  // 修改机构人员
  updateJgryApi: async (data: OrganizationStaffVO) => {
    return await request.put({ url: `/qis/organization-staff/update`, data })
  },

// 删除机构人员
  deleteJgryApi: async (id: number) => {
    return await request.delete({ url: `/qis/organization-staff/delete?ids=` + id })
  }
}
